# atob: https://www.runoob.com/jsref/met-win-atob.html
# btoa: https://www.runoob.com/jsref/met-win-btoa.html
import base64

# 编码
# window.btoa('javascript')        -->  amF2YXNjcmlwdA==
print(base64.b64encode('javascript'.encode()))

# 解码
# window.atob('amF2YXNjcmlwdA==')  -->  javascript
base64.b64decode(b'amF2YXNjcmlwdA==').decode()

print("==>", '123'.encode('ascii'))
print("==>", '123'.encode('ascii').decode('utf-8'))
